﻿/**
*诉讼审批
*/
Chenxin.UI.AuditingLitigationForm = Chenxin.extend(Chenxin.UI.FormCommon, {
    actionUrl: '/service/logic/ShowListLitigation.ashx',
    id: 'AudLit',
    renderTo: 'divAuditing',
    title: '诉讼审批',
    jqmWidth: 600,
    defBBtn:true,
    createForm: function() {
        return Chenxin.FormCommon.AuditingLitigationForm(this.id);
    },
    initEvent: function() {
        var _this = this;
        
		//是否诉讼控制
        this.findByName('AduRst').bind('click',function(){
            $('#tr_ApproveEmployee')[this.value=='20'?'show':'hide']();
            $('#tr_ApproveReason')[this.value=='20'?'show':'hide']();
            $('#tr_Suggestion')[this.value=='20'?'show':'hide']();
        });
    },
    createComboList:function(){
        //审批部门
        var comboApproveDepartId = new Chenxin.UI.StructCombo({
			param:{op:'getcontroldeparts'},
			containerId: '#ApproveDepartId',
			name:'ApproveDepartId',
			inModelType:'all',
			txtModelName:'ApproveDepart',
			required:true,
			tbxWidth: 120,
			hasSearch:true,
			hasPage:true,
			onSelected:function(){
				if( this.getValue() != this.defVal ){
					comboApproveEmployeeId.loadUser(this.getValue());
				}
			},
			afterSetValue:function(newVal,oldVal){
			    if( newVal != "请选择" ){
			       comboApproveEmployeeId.loadUser(newVal);
				}
			}
		});
        //审批人
		var comboApproveEmployeeId =new Chenxin.UI.RichModelTreeCombo({
            textBoxId:'ApproveEmployeeId',
            containerId:'#ApproveEmployeeId',
            inModelType:'all',
			txtModelName:'ApproveEmployee',
            required:false,
            singleSelect:true,
			name:'ApproveEmployeeId'
        });
        return [comboApproveDepartId,comboApproveEmployeeId];
    },
    saveSucc: function() {
        this.reloadGrid();
    },
    initComponent: function() {
        Chenxin.UI.AuditingLitigationForm.superclass.initComponent.call(this);
    }
});

Chenxin.FormCommon.AuditingLitigationForm=function(formID){
	return '<table class="tbl_f"><tr><th style="width:105px; height:26px;">成交编号：</th><td><input name="ContractCode" class="inputbox_n fl" type="text" readonly="readonly" style="width:150px;"/></td></tr><tr><th>物业地址：</th><td colspan="3"><input name="HouseAddress" class="inputbox_n fl" type="text" style="width:435px;"readonly="readonly"/></td></tr><tr><th>提交部门：</th><td><input name="AppDepart" class="inputbox_n fl" type="text" readonly="readonly" style="width:150px;"/></td><th>诉讼时间：</th><td><input id="AppDate" name="AppDate" class="inputbox_n fl" type="text" style="width:150px; readonly="readonly"/></td></tr><tr><th>涉诉金额：</th><td><input name="LitigationMoney" class="inputbox_n fl" type="text" style="width:150px;readonly="readonly"/>元</td><th>诉讼对象：</th><td><input name="LitigationPerson" class="inputbox_n fl" type="text" style="width:150px;"readonly="readonly"/></td></tr><tr><th>审批结果：</th><td><input type="radio" value="10" name="AduRst" />通过<input type="radio" value="20" name="AduRst" />否决</td></tr><tr id="tr_ApproveEmployee" style="display:none;"><th>审批部门：</th><td><div id="ApproveDepartId" style="z-index:8; margin-right: 2px;" class="SelectWrapSingle"></div></td><th>审批人：</th><td><input type="text" id="ApproveEmployeeId"  class="inputbox_n fl" style="width:150px" /></td></tr><tr id="tr_ApproveReason" style="display:none;"><th>理由：</th><td colspan="3"><textarea id="ApproveReason" name="ApproveReason" cols="80" rows="2" style="width: 435px; height: 65px;"class="textarea_n fl"></textarea></td></tr><tr id="tr_Suggestion" style="display:none;"><th>处理建议：</th><td colspan="3"><textarea id="Suggestion" name="Suggestion" cols="80" rows="2" style="width: 435px; height: 65px;" class="textarea_n fl"></textarea></td></tr><tr><td colspan="2" ><input type="hidden"  name="RecordId" /></td></tr></table>';
};